using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FiltronASP.Helpers.FileUpload;

namespace FiltronASP.Helpers.HtmlTags
{
    /// <summary>
    /// Klasa pomocnicza do pobierania linkow do statycznej zawartosci.
    /// </summary>
    public static class ContentHelper
    {
        /// <summary>
        /// Klasa pomocnicza do pobierania linka do obrazkow w panelu admina.
        /// </summary>
        /// <param name="urlHelper">url helper z c#</param>
        /// <param name="imgFileName">nazwa obrazka</param>
        public static string GenerateAdminImageLink(this UrlHelper urlHelper, string imgFileName)
        {
            if (String.IsNullOrEmpty(imgFileName))
            {
                return String.Empty;
            }   //if
            return urlHelper.Content("~/Content/Admin/Images/" + imgFileName);
        }

        /// <summary>
        /// Klasa pomocnicza do pobierania linka do flasha w panelu admina.
        /// </summary>
        /// <param name="urlHelper">url helper z c#</param>
        /// <param name="swfFileName">nazwa obiektu flashowego</param>
        public static string GenerateSwfLink(this UrlHelper urlHelper, string swfFileName)
        {
            if (String.IsNullOrEmpty(swfFileName))
            {
                return String.Empty;
            }   //if
            return urlHelper.Content("~/Content/Admin/SWF/" + swfFileName);
        }

        /// <summary>
        /// Klasa pomocnicza do pobierania linka do obrazka zuploadowanego przez usera.
        /// </summary>
        /// <param name="urlHelper">url helper z c#</param>
        /// <param name="imgFileName">nazwa obrazka</param>
        public static string GenerateUploadedImageLink(this UrlHelper urlHelper, string imgFileName)
        {
            if (String.IsNullOrEmpty(imgFileName))
            {
                return String.Empty;
            }   //if
            return urlHelper.Content(Path.Combine(UploadConsts.UPLOADED_IMAGE_ABSOLUTE_DIR, imgFileName));
        }

    }
}
